package com.dynamic.mybatis.bootstrap.handler;

import com.dynamic.mybatis.core.intercept.DynamicSqlSessionHandler;
import com.dynamic.mybatis.core.metadata.DynamicMappedStatement;
import org.springframework.stereotype.Component;

/**
 * @Description
 * @Author xs
 * @Date 2023/5/23 13:28
 */
@Component
public class MySqlSessionHandler implements DynamicSqlSessionHandler {
    @Override
    public Object before(DynamicMappedStatement dms, Object parameter) {
        System.err.println("before sqlSession handle.   " + dms.getId());
        return parameter;
    }

    @Override
    public Object after(DynamicMappedStatement dms, Object parameter, Object result) {
        System.err.println("after sqlSession handle.   " + dms.getId());
        return result;
    }
}